import request from '@/utils/request'
//随机获取书籍
export function randomBook(){
    return request ({
        method: 'get',
        url: '/book/findRandomBook'
    })
}
//获取轮播图书籍
export function bannerBook(){
    return request ({
        method: 'get',
        url: '/book/selectTypeBookById/12'
    })
}
//获取某类型下所有书籍
export function typeBooks(typeId) {
    return request ({
        method: 'get',
        url: '/book/selectTypeBookById/'+typeId
    })
}
//查询书籍详情
export function bookInfo(bookId) {
    return request ({
        method: 'get',
        url: '/book/findIdBook/'+bookId
    })
}
//名称查询书籍
export function bookByName(bookname) {
    return request ({
        method: 'get',
        url: '/book/findNameBook/'+bookname
    })
}
//书籍热度总排行
export function bookRank(){
    return request ({
        method: 'get',
        url: '/book/findBookRanking'
    })
}
//书籍id查询书籍所有章节
export function capterList(bookId){
    return request({
        method: 'get',
        url: '/book/findBookIdChapter/'+bookId
    })
}
//加入书架
export function addRack(id){
    return request({
        method: 'post',
        url:'/book/InsertByIdBookRank/'+id
    })
}

export default  { 
    randomBook,
    bannerBook,
    typeBooks,
    bookInfo,
    bookByName,
    bookRank,
    capterList
 }